package se.haaga.jsupervision.listeners;

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import se.haaga.jsupervision.gui.MainWindow;

public class JUbuntuWindowListener implements WindowListener {
	
	public JUbuntuWindowListener() {
	}

	@Override
	public void windowActivated(WindowEvent e) {
		// Do nothing
	}

	@Override
	public void windowClosed(WindowEvent e) {
		// Do nothing
	}

	@Override
	public void windowClosing(WindowEvent e) {
		if (e.getSource() instanceof MainWindow) {
			MainWindow mw = (MainWindow) e.getSource();
			mw.confirmExit();
		}
	}

	@Override
	public void windowDeactivated(WindowEvent e) {
		// Do nothing
	}

	@Override
	public void windowDeiconified(WindowEvent e) {
		// Do nothing
	}

	@Override
	public void windowIconified(WindowEvent e) {
		// Do nothing
	}

	@Override
	public void windowOpened(WindowEvent e) {
		// Do nothing
	}

}
